package nmrworkflow.framework.beans.datasets;

import java.util.Vector;

import nmrworkflow.framework.beans.NmrAcquisitionDimension;

/**
 * Bean for storing NMR file info.
 * @author rjn
 *
 */
public abstract class NmrDataSet<T>
{
	
	protected T data;
	private Vector<NmrAcquisitionDimension> dimensions;
	
	public NmrDataSet()
	{
		this.data = null;
		dimensions = new Vector<NmrAcquisitionDimension>();
	}
	
	public NmrDataSet(T data)
	{
		this.data = data;
		dimensions = new Vector<NmrAcquisitionDimension>();
	}
	
	public NmrAcquisitionDimension getDimension(int dimension)
	{
		return dimensions.get(dimension);
	}
	
	public void setDimension(NmrAcquisitionDimension dimension)
	{
		this.dimensions.add(dimension.getDimensionID(), dimension);
	}

	public Vector<NmrAcquisitionDimension> getDimensions()
	{
		return dimensions;
	}

	public void setDimensions(Vector<NmrAcquisitionDimension> dimensions)
	{
		this.dimensions = dimensions;
	}
	
	public int getNumberDimensions()
	{
		return this.dimensions.size();
	}

	public T getData()
	{
		return data;
	}

	public void setData(T data)
	{
		this.data = data;
	}
	
	abstract public NmrDataSet<T> clone();
}
